package b.m;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.graphics.Paint;
import android.view.View;
import android.view.ViewGroup;
import b.f.l.s;

public class d extends j0 {

    class a extends n {

        /* renamed from: a  reason: collision with root package name */
        final /* synthetic */ View f1410a;

        a(d dVar, View view) {
            this.f1410a = view;
        }

        public void e(m mVar) {
            c0.g(this.f1410a, 1.0f);
            c0.a(this.f1410a);
            mVar.P(this);
        }
    }

    private static class b extends AnimatorListenerAdapter {

        /* renamed from: a  reason: collision with root package name */
        private final View f1411a;

        /* renamed from: b  reason: collision with root package name */
        private boolean f1412b = false;

        b(View view) {
            this.f1411a = view;
        }

        public void onAnimationEnd(Animator animator) {
            c0.g(this.f1411a, 1.0f);
            if (this.f1412b) {
                this.f1411a.setLayerType(0, (Paint) null);
            }
        }

        public void onAnimationStart(Animator animator) {
            if (s.H(this.f1411a) && this.f1411a.getLayerType() == 0) {
                this.f1412b = true;
                this.f1411a.setLayerType(2, (Paint) null);
            }
        }
    }

    public d(int i) {
        i0(i);
    }

    private Animator j0(View view, float f, float f2) {
        if (f == f2) {
            return null;
        }
        c0.g(view, f);
        ObjectAnimator ofFloat = ObjectAnimator.ofFloat(view, c0.f1409b, new float[]{f2});
        ofFloat.addListener(new b(view));
        a(new a(this, view));
        return ofFloat;
    }

    /* JADX WARNING: Code restructure failed: missing block: B:1:0x0002, code lost:
        r1 = (java.lang.Float) r1.f1466a.get("android:fade:transitionAlpha");
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    private static float k0(b.m.s r1, float r2) {
        /*
            if (r1 == 0) goto L_0x0012
            java.util.Map<java.lang.String, java.lang.Object> r1 = r1.f1466a
            java.lang.String r0 = "android:fade:transitionAlpha"
            java.lang.Object r1 = r1.get(r0)
            java.lang.Float r1 = (java.lang.Float) r1
            if (r1 == 0) goto L_0x0012
            float r2 = r1.floatValue()
        L_0x0012:
            return r2
        */
        throw new UnsupportedOperationException("Method not decompiled: b.m.d.k0(b.m.s, float):float");
    }

    public Animator e0(ViewGroup viewGroup, View view, s sVar, s sVar2) {
        float f = 0.0f;
        float k0 = k0(sVar, 0.0f);
        if (k0 != 1.0f) {
            f = k0;
        }
        return j0(view, f, 1.0f);
    }

    public Animator g0(ViewGroup viewGroup, View view, s sVar, s sVar2) {
        c0.e(view);
        return j0(view, k0(sVar, 1.0f), 0.0f);
    }

    public void j(s sVar) {
        super.j(sVar);
        sVar.f1466a.put("android:fade:transitionAlpha", Float.valueOf(c0.c(sVar.f1467b)));
    }
}
